package org.compression.controller;

import org.compression.services.imp.UserServiceImp;
import org.model.auth.AuthGroup;
import org.model.auth.UserGroup;
import org.model.comm.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/manage")
public class UserController {
	
	
	@Autowired
	UserServiceImp mUserServiceImp;

	@RequestMapping(value="/page/user",method=RequestMethod.POST)
	public Object getMember(@RequestBody Page page) {		
		return mUserServiceImp.getMember(page);
	}
	
	
	@RequestMapping(value="/page/group",method=RequestMethod.POST)
	public Object getGroup(@RequestBody Page page) {		
		return mUserServiceImp.getGroups(page);
	}
	
	@RequestMapping(value="/page/magezines",method=RequestMethod.POST)
	public Object getMagazinePage(@RequestBody Page page) {		
		return mUserServiceImp.getMagazinePage(page);
	}
	
	@RequestMapping(value="/page/getGroupRelate/{id}",method=RequestMethod.GET)
	public Object  getGroupRelate(@PathVariable String id) {
		return  mUserServiceImp.getGroupRelate(id);
	}
	
	//插入管理关系
	@RequestMapping(value="/page/insertGroupRelate",method=RequestMethod.POST)
	public Object  insertGroupMagazineId(@RequestBody AuthGroup mAuthGroup) {
		return  mUserServiceImp.insertGroupMagazineId(mAuthGroup);
	}
	
	//删除关系
	@RequestMapping(value="/page/deleteRelate",method=RequestMethod.POST)
	public Object  deleteRelate(@RequestBody AuthGroup mAuthGroup) {
		 return  mUserServiceImp.deleteRelate(mAuthGroup);
	}
	
	//组与员工关系
	@RequestMapping(value="/page/getMembersGroup/{id}",method=RequestMethod.GET)
	public Object  getMembersGroup(@PathVariable String id) {
		 return  mUserServiceImp.getMembersGroup(id);
	}
	
	
	@RequestMapping(value="/deleteUserRelate",method=RequestMethod.DELETE)
	public Object  deleteUserRelate(@RequestBody UserGroup mUserGroup) {
		 return  mUserServiceImp.deleteUserRelate(mUserGroup);
	}
	
	
	@RequestMapping(value="/insertSelective",method=RequestMethod.POST)
	public Object  insertSelective(@RequestBody UserGroup mUserGroup) {
		 return  mUserServiceImp.insertSelective(mUserGroup);
	}
	
	@RequestMapping(value="/page/getPageBussiness",method=RequestMethod.POST)
	public Object  getPageBussiness(@RequestBody Page mPage) {
		 return  mUserServiceImp.getPageBussiness(mPage);
	}

	//企业用户关联
	@RequestMapping(value="getBussinetableDataRealte",method=RequestMethod.GET)
	public Object  getBussinetableDataRealte() {
		 return  mUserServiceImp.getBussinetableDataRealte();
	}
	
	
	
	
}
